home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / amac41.zip / BUFF12.QM < prev    next >
Text File  |  1991-08-26  |  50KB  |  929 lines

  1. *                               BUFF12.QM
  2. *     Access Scratch Buffers with the Previous Buffer Name at Prompt
  3. *     Save and Reload Currently Loaded Buffers at Next Edit Session
  4. *                                8/25/91
  5. *
  6. *     ─────────────────────────── INDEX ────────────────────────────
  7. *     @(1) - STORE or Copy Marked Block with Buffer Name at Prompt
  8. *     @(2) - GET or Insert Buffer Contents with Buffer Name at Prompt
  9. *     @(3) - APPEND Marked Block with Buffer Name at Prompt
  10. *     @(4) - Remove Buffer Contents with Buffer Name at Prompt
  11. *
  12. *     @(7) - GET or Insert Buffer Contents Selected From a PickList    P
  13. *     @(8) - Remove Buffer Contents Selected From a PickList
  14. *
  15. *     @(6) - View Contents of All Currently Loaded Buffers
  16. *     @(9) - Save Contents of All Currently Loaded Buffers
  17. *     @(0) - Load Buffers From Previous Edit Session                   P
  18. *
  19. *     (Description)
  20. *     (Configuration) Required  <--- Please read this FIRST
  21. *     (Macros)
  22. *     (Version) History
  23. *
  24. *--- eoi
  25.  
  26.  
  27. * (DESCRIPTION)
  28.  
  29. *     These macros access and manipulate Scratch Buffers the same way
  30. *     StoreScrBuff, GetScrBuff and AppendScrBuff do except the last
  31. *     accessed buffer name is entered at the buffer name prompt when
  32. *     macros @1 - @4 are invoked.  This is especially useful when a few
  33. *     Scratch Buffers are frequently accessed because QEdit does not
  34. *     remember and show the last accessed Scratch Buffer name at the
  35. *     buffer name prompt without having to recall and enter the buffer
  36. *     name.  Macro @6 will show the contents of all loaded Scratch
  37. *     Buffers by name.  Macros @7 and @8 enable the user to access
  38. *     Scratch Buffers from a PickList of all loaded Scratch Buffers by
  39. *     name.  All currently loaded Scratch Buffers may also be saved
  40. *     with @9 and reloaded with @0 at the next edit session or at start
  41. *     up.
  42.  
  43. *     All macros, except @0, will fit on one line of QCONFIG.DAT by
  44. *     removing the 'Label' and 'Macro_Begin' from the QMAC compiled
  45. *     macros and formatting with a right margin of 500, and then
  46. *     using joinline to get any remaining commands on the same line.
  47.  
  48. *     Macros @1 - @6 will work with line, character or column blocks,
  49. *     however macros @7 -@0 will ONLY work with line or character
  50. *     blocks, NO column blocks.
  51.  
  52.  
  53. * (CONFIGURATION)
  54.  
  55. * NOTE: Macros @1 - @4 are the only macros not requiring configuration.
  56. *       You must change 'e:\up\' in macros @6 - @0 to your directory
  57. *       containing the files for BUFFxx.QM macros, then recompile using
  58. *       QMAC.  The following files must either exist or must be made as
  59. *       described below:
  60.  
  61. *             BUFF.BAT   batch file to invoke @0
  62. *             BUFF.NAM   list of Scratch Buffer names to be used
  63. *             BUFF.ALL   all currently loaded Scratch Buffers,
  64. *                        @9 makes this file when invoked
  65.  
  66. * (MACROS)
  67.  
  68. * 
  69. * ----------------------------------------------
  70. * @(0) Load Buffers From Previous Edit Session
  71. * ----------------------------------------------
  72.  
  73. *     This macro enables the user to load, either upon start up or
  74. *     while editing, all Scratch Buffers that were saved in the last
  75. *     edit session using @9.  This macro is a modification of a macro
  76. *     in the QEdit documentation to load a set of "standard" buffers.
  77. *     @0 may also be invoked while editing.
  78.  
  79. *     This macro will ONLY work with line or character blocks, NO
  80. *     column blocks.  Any column block buffer saved with @9 will be
  81. *     loaded with @0 as a CHARACTER block.  To run, invoke this macro
  82. *     at any time or at startup as described below, and the macro
  83. *     terminates with all buffers that were saved in the last editing
  84. *     session with @9 loaded and shown in the NUL file for viewing.  The
  85. *     NUL file may be quit but this is not necessary.
  86.  
  87. *     To invoke this macro at start up and load this file, it's macros,
  88. *     and the scratch buffers saved in the last editing session, use
  89. *     the following batch file BUFF.BAT contained in AMACxx.ZIP:
  90.  
  91. *     ┌────────────────────── BUFF.BAT ──────────────────────┐
  92. *     │                                                      │
  93. *     │    Q   BUFF12.QM   /EBUFF12.MAC    /LBUFF12.MAC      │
  94. *     │                                                      │
  95. *     └──────────────────────────────────────────────────────┘
  96.  
  97. *     The user may wish to modify BUFF.BAT by changing e:\up\ in the
  98. *     statement line to the directory containing BUFF.BAT so that all
  99. *     macros in BUFFxx.QM will be available to invoke from any
  100. *     directory.  To invoke this macro while editing press @0.
  101.  
  102. *     NOTE: You must change 'e:\up\' in this macro to your directory
  103. *           containing BUFF.ALL.  @0 must be the first macro in this
  104. *           file to autoexecute on start up.  All Scratch Buffers will
  105. *           be changed to character blocks with @6 and @0.
  106.  
  107. @0 macrobegin
  108. * ------------- Load Buffers From Previous Edit Session -------------*
  109.         editfile
  110.             'e:\up\BUFF.ALL' return     * Load last buffer file
  111.                                         * Change 'e:\up\' to your directory
  112.         begfile                         * Go to the top of it
  113.         markline copy                   * Copy first buffer name to scrap
  114.         cursordown                      * Cursor down to first buffer
  115.         markblockbegin                  * Mark beginning of buffer
  116.         find #254 return delline return * Find the end of the buffer marker
  117.         markblockend                    * Mark the end of buffer
  118.         storescrbuff paste return       * Store the buffer to name
  119.         cursordown                      * Cursor down to second buffer
  120.     LOOP:                               * Do same thing for next buffer
  121.         unmarkblock                     * Clear buffer content block
  122.         begline                         * Re-position from Find
  123.         markline                        * Mark buffer name
  124.         copy                            * Copy name to scrap
  125.         cursordown                      * Are we at bottom of file yet?
  126.     jfalse DONE:                        * If we can't cursor down, we're done
  127.         markblockbegin                  *ELSE mark buffer begin
  128.         repeatfind                      * Find end of buffer marker
  129.         cursorleft                      * Test if we're on marker in col 1
  130.     jtrue 1:                            * If true, we're not in col 1
  131.         insertline                      *ELSE we need to insert line for buff
  132.         cursordown                      * Move back to marker line
  133.     jump 2:                             * Bypass next line
  134.     1:  cursorright                     * Position cursor back on marker
  135.     2:  markblockend                    * Mark buffer end
  136.         storescrbuff paste return       * Store buffer to name
  137.         cursordown                      * Cursor down to next buffer name
  138.     jump LOOP:                          * Loop again
  139.     DONE:                               * Come here when no more names
  140.         quit                            * Quit BUFF.ALL
  141. * ---------- View Contents of All Currently Loaded Buffers ----------*
  142.         onewindow                       * In case @0 invoked while editing
  143.         editfile "NUL" return quit      * Quit NUL file if loaded
  144.         horizontalwindow                * Make two windows
  145.         editfile return                 * Load empty NUL file
  146.         readblock                       * Read file of buffer names
  147.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  148.     LOOP2:                              *
  149.         begline                         * Needed in loop
  150.         unmarkblock                     *
  151.         markline                        * Mark next buffer name
  152.         copy                            * Copy name to scrap
  153.         addline                         * Make room for buff contents
  154.         getscrbuff paste return         * Get buffer contents
  155.         endline                         * Pos and test if buff has contents
  156.     jfalse NOBUFF:                      * If buffer has no contents, move on
  157.         gotoblockend                    * Go to end of buffer contents
  158.         ENDLINE                         * Pos for end of buffer mark
  159.                                         * Needed for last buffer line blank
  160.         #254                            * Add end of buffer mark
  161.         cursordown                      * Move down to next line
  162.         begline endline                 * Test if line is blank
  163.     jfalse DELLINE:                     * If blank, go delete it
  164.     jump LOOP2:                         *ELSE loop again
  165.     NOBUFF:                             * Come here if nothing in buffer
  166.         cursordown                      * Test if we're at end of buffer names
  167.     jfalse PICK:                        * If false, PickList is made
  168.         cursorup                        *ELSE cursor up to blank line
  169.         cursorup                        * and to name with no content
  170.         delline                         * Delete buffer name
  171.     DELLINE:                            *
  172.         delline                         * Delete blank line
  173.     jump LOOP2:                         * Loop again
  174.     PICK:                               * Come here to select from PickList
  175.         zoomwindow                      * Full window for visibity
  176.         unmarkblock                     * Clear last buffer content's block
  177.         begfile                         * Position to view
  178.         onewindow                       * Close windows if QConfig
  179.     END:                                * set to NOT close on quit
  180. *
  181. * 162 bytes Tue  08-20-1991  11:21:31 (TH @0)
  182.  
  183. * 
  184. * --------------------------------------------------------------------------
  185. * @(1) STORE or Copy Marked Block to Previous or New Buffer Name,
  186. *      Previous Buffer Name is Entered at Request for Buffer Name Prompt
  187. * --------------------------------------------------------------------------
  188.  
  189. *     This macro copies the currently marked Block to the named Scratch
  190. *     Buffer.  The last accessed buffer name is entered at request for
  191. *     buffer name prompt.  Blocks may be either line, character or
  192. *     column blocks--open or closed.
  193.  
  194. *     The editor will prompt for the name of the Scratch Buffer with
  195. *     this macro entering the name of the last accessed buffer invoked,
  196. *     on the 'Request for Buffer Name Prompt' line.  If no buffer has
  197. *     been previously named with these macros, the 'Buffer Name Prompt'
  198. *     is blank for user entry.  The previously named buffer may be
  199. *     overwritten or selected by hitting <enter>.  If no buffer name is
  200. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  201. *     the default Scratch Buffer name dot '.'
  202.  
  203. @1 macrobegin
  204.         onewindow
  205.         editfile "NUL" return quit      * Quit NUL file if loaded
  206.         GotoBlockBeg                    * Test if closed
  207.    jfalse END:                          *
  208.         storescrbuff "t" return         * Store block to temp buff 't'
  209.         deleteblock                     * Delete block to put back later
  210.         horizontalwindow                * Make two windows
  211.         editfile return                 * Load empty NUL file
  212.         "a" cursorleft "a" endline      * Test line for Insert status
  213.     jfalse OFF: toggleinsert            * Toggle Insert Off if On
  214.     OFF: delline                        * Delete test line
  215.         getscrbuff "n" return           * Get previous buff 'n'
  216.         gotoblockbeg                    * Test if buff 'n' had contents
  217.     jtrue NEXT:                         * If buffer exists, bypass next line
  218.         dropanchor                      *ELSE make dummy block so cut does
  219.                                         *  not cut empty line to scrap
  220.     NEXT:                               *
  221.         cut                             * Cut prev buff name to scrap
  222.         "Buff="                         * Insert Buff= on top line of NUL
  223.         paste                           * Paste prev buff name
  224. *         unmarkblock                     *
  225.         markcharacter                   * Start character block
  226.         zoomwindow                      * Make NUL file full window
  227.         Pause                           * Pause for new name, or prev
  228.         endline                         * Get all name in block
  229.         dropanchor                      * Close block
  230.         gotoblockbeg                    * Pos cursor on first char of name
  231.         endline                         * Test if char exists
  232.     jtrue HasName:                      * If true, buff has name
  233.         "."                             *ELSE no buff named, name it 'dot'
  234.     HasName:                            * Buff now has name
  235.         storescrbuff "n" return         * Store name to buff 'n'
  236.         copy                            * Copy buff name to scrap
  237.         getscrbuff "t" return           * Insert temp buff 't'
  238.         storescrbuff paste return       * Save it with new buff name
  239.         toggleinsert                    * Toggle Insert back On
  240.         quit                            * Quit NUL file
  241.         prevwindow                      * Return to starting file
  242.         getscrbuff paste return         * Put orig block back where it was
  243.         onewindow                       * Close all windows if QConfig
  244.     END:                                * set to NOT close on quit
  245. *
  246. * 89 bytes Mon  08-19-1991  13:42:56 (TH @1)
  247.  
  248. * 
  249. * --------------------------------------------------------------------------
  250. * @(2) GET or Insert Previous or New Buffer Name Contents at Cursor Position,
  251. *      Previous Buffer Name is Entered at Request for Buffer Name Prompt
  252. * --------------------------------------------------------------------------
  253.  
  254. *     This macro inserts the contents of the named Scratch Buffer at
  255. *     the cursor position.  The last accessed buffer name is entered at
  256. *     request for buffer name prompt.  Blocks may be either line,
  257. *     character or column blocks--open or closed.
  258.  
  259. *     The editor will prompt for the name of the Scratch Buffer.  The
  260. *     macro enters the name of the last accessed buffer name invoked on
  261. *     the 'Request for Buffer Name Prompt' line.  If no buffer has been
  262. *     previously named with these macros, the 'Buffer Name Prompt' is
  263. *     blank for user entry.  The previously named buffer may be
  264. *     overwritten or selected by hitting <enter>.  If no buffer name is
  265. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  266. *     the scratch buffer name dot '.'
  267.  
  268. @2 macrobegin
  269.         onewindow                       * Close all windows
  270.         dropanchor                      * Mark starting file to return to
  271.         editfile "NUL" return quit      * Quit NUL file if loaded
  272.         GotoBlockBeg                    * Return to starting file
  273.         unmarkblock                     * Unmark
  274.         horizontalwindow                * Make two windows
  275.         editfile return                 * Load empty NUL file
  276.         "a" cursorleft "a" endline      * Test line for Insert status
  277.     jfalse OFF: toggleinsert            * Toggle Insert Off if On
  278.     OFF: delline                        * Delete test line
  279.         getscrbuff "n" return           * Get previous buff 'n'
  280.         gotoblockbeg                    * Test if buff 'n' had contents
  281.     jtrue NEXT:                         * If buffer exists, bypass next line
  282.         dropanchor                      * Make dummy block so cut does not
  283.                                         *  cut empty line to scrap
  284.     NEXT:                               *
  285.         cut                             * Cut prev buff name to scrap
  286.         "Buff="                         * Insert Buff= on top line of NUL
  287.         paste                           * Paste prev buff name
  288. *         unmarkblock                     *
  289.         markcharacter                   * Start character block
  290.         zoomwindow                      * Make NUL file full window
  291.         pause                           * Pause for new name, or prev
  292.         endline                         * Get all name in block
  293.         dropanchor                      * Close block
  294.         gotoblockbeg                    * Pos cursor on first char of name
  295.         endline                         * Test if char exists
  296.     jtrue HasName:                      * If true, buff has name
  297.         "."                             *ELSE no buff named, name it 'dot'
  298.     HasName:                            * Buff now has name
  299.         storescrbuff "n" return         * Store name to buff 'n'
  300.         copy                            * Copy buff name to scrap
  301.         toggleinsert                    * Toggle Insert back On
  302.         quit                            * Quit NUL file
  303.         prevwindow                      * Return to starting file
  304.         getscrbuff paste return         * Insert buff contents here
  305.         onewindow                       * Close all windows if QConfig
  306.     END:                                * set to NOT close on quit
  307. *
  308. * 76 bytes Mon  08-19-1991  13:43:05 (TH @2)
  309.  
  310.  
  311. * 
  312. * --------------------------------------------------------------------------
  313. * @(3) APPEND Marked Block to End of Previous or New Buffer Name,
  314. *      Previous Buffer Name is Entered at Request for Buffer Name Prompt
  315. * --------------------------------------------------------------------------
  316.  
  317. *     This macro appends the currently marked Block to the end of the
  318. *     named Scratch Buffer.  The last accessed buffer name is entered
  319. *     at request for buffer name prompt.  The existing contents of the
  320. *     named Scratch Buffer are not lost invoking this macro.  If the
  321. *     named Scratch Buffer does not exist, a new Scratch Buffer will be
  322. *     created.  Blocks may be either line, character or column
  323. *     blocks--open or closed.
  324.  
  325. *     The editor will prompt for the name of the Scratch Buffer.  The
  326. *     macro enters the name of the last accessed buffer name invoked on
  327. *     the 'Request for Buffer Name Prompt' line.  If no buffer has been
  328. *     previously named with these macros, the 'Buffer Name Prompt' is
  329. *     blank for user entry.  The previously named buffer may be
  330. *     overwritten or selected by hitting <enter>.  If no buffer name is
  331. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  332. *     the scratch buffer name dot '.'
  333.  
  334. @3 macrobegin
  335.         onewindow
  336.         editfile "NUL" return quit      * Quit NUL file if loaded
  337.         GotoBlockBeg                    * Test if closed
  338.    jfalse END:                          *
  339.         storescrbuff "t" return         * Store block to temp buff 't'
  340.         deleteblock                     * Delete block to put back later
  341.         horizontalwindow                * Make two windows
  342.         editfile return                 * Load empty NUL file
  343.         "a" cursorleft "a" endline      * Test line for Insert status
  344.     jfalse OFF: toggleinsert            * Toggle Insert Off if On
  345.     OFF: delline                        * Delete test line
  346.         getscrbuff "n" return           * Get previous buff 'n'
  347.         gotoblockbeg                    * Test if buff 'n' had contents
  348.     jtrue NEXT:                         * If buffer exists, bypass next line
  349.         dropanchor                      * Make dummy block so cut does not
  350.                                         *  cut empty line to scrap
  351.     NEXT:                               *
  352.         cut                             * Cut prev buff name to scrap
  353.         "Buff="                         * Insert Buff= on top line of NUL
  354.         paste                           * Paste prev buff name
  355. *         unmarkblock                     *
  356.         markcharacter                   * Start character block
  357.         zoomwindow                      * Make NUL file full window
  358.         pause                           * Pause for new name, or prev
  359.         endline                         * Get all name in block
  360.         dropanchor                      * Close block
  361.         gotoblockbeg                    * Pos cursor on first char of name
  362.         endline                         * Test if char exists
  363.     jtrue HasName:                      * If true, buff has name
  364.         "."                             *ELSE no buff named, name it 'dot'
  365.     HasName:                            * Buff now has name
  366.         storescrbuff "n" return         * Store name to buff 'n'
  367.         copy                            * Copy buff name to scrap
  368.         getscrbuff "t" return           * Insert temp buff 't'
  369.         appendscrbuff paste return      * Append block to buff 'n'
  370.         toggleinsert                    * Toggle Insert back On
  371.         quit                            * Quit NUL file
  372.         prevwindow                      * Return to starting file
  373.         getscrbuff "t" return           * Put orig block back where it was
  374.         onewindow                       * Close all windows if QConfig
  375.     END:                                * set to NOT close on quit
  376. *
  377. * 90 bytes Mon  08-19-1991  13:43:01 (TH @3)
  378.  
  379.  
  380.  
  381. * 
  382. * --------------------------------------------------------------------------
  383. * @(4) Remove Buffer Contents with Previous Buffer Name at Prompt
  384. * --------------------------------------------------------------------------
  385.  
  386. *     This macro removes the contents of the named Scratch Buffer.  The
  387. *     last accessed buffer name is entered at request for buffer name
  388. *     prompt.  Blocks may be either line, character or column
  389. *     blocks--open or closed.  This macro is useful for freeing up
  390. *     buffer space or removing buffers before saving with @9.
  391.  
  392. *     The editor will prompt for the name of the Scratch Buffer.  The
  393. *     macro enters the name of the last accessed buffer name invoked on
  394. *     the 'Request for Buffer Name Prompt' line.  If no buffer has been
  395. *     previously named with these macros, the 'Buffer Name Prompt' is
  396. *     blank for user entry.  The previously named buffer may be
  397. *     overwritten or selected by hitting <enter>.  If no buffer name is
  398. *     entered at the 'Request for Buffer Name Prompt', the macro uses
  399. *     the scratch buffer name dot '.'
  400.  
  401. @4 macrobegin
  402.         onewindow                       * Close all windows
  403.         dropanchor                      * Mark starting file to return to
  404.         editfile "NUL" return quit      * Quit NUL file if loaded
  405.         GotoBlockBeg                    * Return to starting file
  406.         unmarkblock                     * Unmark
  407.         horizontalwindow                * Make two windows
  408.         editfile return                 * Load empty NUL file
  409.         "a" cursorleft "a" endline      * Test line for Insert status
  410.     jfalse OFF: toggleinsert            * Toggle Insert Off if On
  411.     OFF: delline                        * Delete test line
  412.         getscrbuff "n" return           * Get previous buff 'n'
  413.         gotoblockbeg                    * Test if buff 'n' had contents
  414.     jtrue NEXT:                         * If buffer exists, bypass next line
  415.         dropanchor                      * Make dummy block so cut does not
  416.                                         *  cut empty line to scrap
  417.     NEXT:                               *
  418.         cut                             * Cut prev buff name to scrap
  419.         "Buff="                         * Insert Buff= on top line of NUL
  420.         paste                           * Paste prev buff name
  421.         markcharacter                   * Start character block
  422.         zoomwindow                      * Make NUL file full window
  423.         pause                           * Pause for new name, or prev
  424.         endline                         * Get all name in block
  425.         dropanchor                      * Close block
  426.         gotoblockbeg                    * Pos cursor on first char of name
  427.         endline                         * Test if char exists
  428.     jtrue HasName:                      * If true, buff has name
  429.         "."                             *ELSE no buff named, name it 'dot'
  430.     HasName:                            * Buff now has name
  431.         storescrbuff "n" return         * Store name to buff 'n'
  432.         copy                            * Copy buff name to scrap
  433.         toggleinsert                    * Toggle Insert back On
  434.         endline dropanchor              * Mark empty block
  435.         storescrbuff paste return       * Store empty block to buff n
  436.                                         * clears it
  437.         quit                            * Quit NUL file
  438.         prevwindow                      * Return to starting file
  439.         onewindow                       * Close all windows if QConfig
  440.     END:                                * set to NOT close on quit
  441. *
  442. * 78 bytes Tue  08-20-1991  11:34:56 (TH @a)
  443.  
  444. * 
  445. * ----------------------------------------------------
  446. * @(6) View Contents of All Currently Loaded Buffers
  447. * ----------------------------------------------------
  448.  
  449. *     This macro enables the user to view the contents of all currently
  450. *     loaded Scratch Buffers.  This macro uses the technique in a macro
  451. *     in the QEdit documentation to load a set of "standard" buffers.
  452. *     This macro will ONLY work with line or character blocks, NO
  453. *     column blocks.  To run, press @6 and <enter> and the contents of
  454. *     all currently loaded Scratch Buffers is shown in the NUL file for
  455. *     viewing in the following form:
  456.  
  457. *     ┌──────   NUL    ──────┐
  458. *     │1                     │<-- Buffer 1 name
  459. *     │Text of buffer 1■     │<-- Buffer 1 content
  460. *     │2                     │<-- Buffer 2 name
  461. *     │This is content of    │<-- Buffer 2 content
  462. *     │buffer number 2.      │               |
  463. *     │                      │               |
  464. *     │Note that buffers may │               |
  465. *     │contain any text      │               |
  466. *     │except for an ASCII   │               |
  467. *     │254.  That is used    │               |
  468. *     │as an end of buffer   │               |
  469. *     │marker                │               |
  470. *     │■                     │<-- NOTE: delimiter on line by itself
  471. *     │3                     │          indicates a blank line.
  472. *     │Buffer 3■             │
  473. *     └──────────────────────┘
  474.  
  475. *     After viewing the buffer contents, the NUL file may be quit but
  476. *     this is not necessary.
  477.  
  478. *     NOTE: You must change 'e:\up\' in this macro to your directory
  479. *           containing BUFF.NAM.  This file must exist for this macro
  480. *           to work and it is easily made as shown below.
  481.  
  482. *     File BUFF.NAM is a list of buffer names to be used:
  483.  
  484. *                 1 to 10
  485. *                 a to z (excluding n and t)
  486. *                 .      (dot)
  487.  
  488. *     ┌─────  BUFF.NAM ──────┐
  489. *     │1                     │<-- Buffer names 1 - 10
  490. *     │2                     │
  491. *     │3                     │
  492. *     │4                     │
  493. *     │5                     │
  494. *     │6                     │
  495. *     │7                     │
  496. *     │8                     │
  497. *     │9                     │
  498. *     │10                    │
  499. *     │a                     │ <-- Buffer names a - z
  500. *     │b                     │     excluding 'n' and 't'
  501. *     │|                     │     reserved for BUFFxx.QM macros.
  502. *     │|                     │
  503. *     │z                     │
  504. *     │.                     │ <-- Buffer name '.' (dot) is
  505. *     └──────────────────────┘     reserved as default name.
  506.  
  507.  
  508. @6 macrobegin
  509.         onewindow
  510.         dropanchor                      * Mark file we're in to return to
  511.         editfile "NUL" return quit      * Quit NUL file if loaded
  512.         gotoblockbeg                    * Return to starting file
  513.         unmarkblock                     * Clear mark
  514.         horizontalwindow                * Make two windows
  515.         editfile return                 * Load empty NUL file
  516.         readblock                       * Read file of buffer names
  517.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  518.     LOOP:                               *
  519.         begline                         * Needed in loop
  520.         unmarkblock                     *
  521.         markline                        * Mark next buffer name
  522.         copy                            * Copy name to scrap
  523.         addline                         * Make room for buff contents
  524.         getscrbuff paste return         * Get buffer contents
  525.         endline                         * Pos and test if buff has contents
  526.     jfalse NOBUFF:                      * If buffer has no contents, move on
  527.         gotoblockend                    * Go to end of buffer contents
  528.         ENDLINE                         * Pos for end of buffer mark
  529.                                         * Needed for last buffer line blank
  530.     jtrue 1:
  531.         gotoblockend
  532.     1:  #254                            * Add end of buffer mark
  533.         cursordown                      * Move down to next line
  534.         begline endline                 * Test if line is blank
  535.     jfalse DELLINE:                     * If blank, go delete it
  536.     jump LOOP:                          *ELSE loop again
  537.     NOBUFF:                             * Come here if nothing in buffer
  538.         cursordown                      * Test if we're at end of buffer names
  539.     jfalse PICK:                        * If false, PickList is made
  540.         cursorup                        *ELSE cursor up to blank line
  541.         cursorup                        * and to name with no content
  542.         delline                         * Delete buffer name
  543.     DELLINE:                            *
  544.         delline                         * Delete blank line
  545.     jump LOOP:                          * Loop again
  546.     PICK:                               * Come here to select from PickList
  547.         zoomwindow                      * Full window for visibity
  548.         unmarkblock                     * Clear last buffer content's block
  549.         begfile                         * Position to view
  550.         onewindow                       * Close windows if QConfig
  551.     END:                                * set to NOT close on quit
  552. *
  553. * 78 bytes Mon  08-19-1991  13:43:19 (TH @6)
  554. * 94 bytes Tue  08-20-1991  11:22:00 (TH @6, added e:\up)
  555.  
  556.  
  557. * 
  558. * ---------------------------------------------------------
  559. * @(7) GET or Insert Buffer Contents at Cursor Position
  560. *      From a PickList of All Currently Loaded Buffers
  561. * ---------------------------------------------------------
  562.  
  563. *     This macro enables the user to insert a Scratch Buffer at the
  564. *     cursor position selected from a PickList of all currently loaded
  565. *     Scratch Buffers.  At the pause, place the cursor line on the name
  566. *     of the buffer to insert and press <enter>.  The selected buffer
  567. *     will be inserted at the cursor position when this macro was
  568. *     invoked.
  569.  
  570. *     This macro will ONLY work with line or character blocks, NO
  571. *     column blocks.
  572.  
  573. *     NOTE: You must change 'e:\up\' in this macro to your directory
  574. *           containing BUFF.NAM.  This file must exist for this macro
  575. *           to work and it is easily be made as shown below.
  576.  
  577. @7 macrobegin
  578.         onewindow
  579.         dropanchor                      * Mark file we're in to return to
  580.         editfile "NUL" return quit      * Quit NUL file if loaded
  581.         gotoblockbeg                    * Return to starting file
  582.         unmarkblock                     * Clear mark
  583.         horizontalwindow                * Make two windows
  584.         editfile return                 * Load empty NUL file
  585.         readblock                       * Read file of buffer names
  586.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  587.     LOOP:                               *
  588.         begline                         * Needed in loop
  589.         unmarkblock                     *
  590.         markline                        * Mark next buffer name
  591.         copy                            * Copy name to scrap
  592.         addline                         * Make room for buff contents
  593.         getscrbuff paste return         * Get buffer contents
  594.         endline                         * Pos and test if buff has contents
  595.     jfalse NOBUFF:                      * If buffer has no contents, move on
  596.         gotoblockend                    * Go to end of buffer contents
  597.         ENDLINE                         * Pos for end of buffer mark
  598.                                         * Needed for last buffer line blank
  599.         #254                            * Add end of buffer mark
  600.         cursordown                      * Move down to next line
  601.         begline endline                 * Test if line is blank
  602.     jfalse DELLINE:                     * If blank, go delete it
  603.     jump LOOP:                          *ELSE loop again
  604.     NOBUFF:                             * Come here if nothing in buffer
  605.         cursordown                      * Test if we're at end of buffer names
  606.     jfalse PICK:                        * If false, PickList is made
  607.         cursorup                        *ELSE cursor up to blank line
  608.         cursorup                        * and to name with no content
  609.         delline                         * Delete buffer name
  610.     DELLINE:                            *
  611.         delline                         * Delete blank line
  612.     jump LOOP:                          * Loop again
  613.     PICK:                               * Come here to select from PickList
  614.         zoomwindow                      * Full window for visibity
  615.         unmarkblock                     * Clear last buffer content's block
  616.         begfile                         * Position to select
  617.         pause                           * Pause to select
  618.         markline copy                   * Copy selected buffer name to scrap
  619.         prevwindow                      * Return to starting file
  620.         getscrbuff paste return         * Insert selected buffer contents here
  621.         prevwindow                      * Return to NUL
  622.         quit                            * Quit NUL
  623.         onewindow                       * Close windows if QConfig
  624.     END:                                * set to NOT close on quit
  625. *
  626. * 99 bytes Tue  08-20-1991  11:21:50 (TH @7)
  627.  
  628. * 
  629. * ----------------------------------------------------
  630. * @(8) Remove Buffer Contents Selected From a
  631. *      PickList of All Currently Loaded Buffers
  632. * ----------------------------------------------------
  633.  
  634. *     This macro enables the user to remove an un-desired Scratch
  635. *     Buffer from currently loaded Scratch Buffers selected from a
  636. *     PickList of all currently active Scratch Buffers.  At the pause,
  637. *     place the cursor line on the name of the buffer to remove and
  638. *     press <enter>.  The selected buffer will be removed or cleared
  639. *     from currently loaded Scratch Buffers as can be confirmed
  640. *     invoking @6 after @8.  This macro is useful for either freeing up
  641. *     memory or removing macros not wished to be saved with @9.
  642.  
  643. *     This macro will ONLY work with line or character blocks, NO
  644. *     column blocks.
  645.  
  646. *     NOTE: You must change 'e:\up\' in this macro to your directory
  647. *           containing BUFF.NAM.  This file must exist for this macro
  648. *           to work and it is easily be made as shown below.
  649.  
  650. @8 macrobegin
  651.         onewindow
  652.         dropanchor                      * Mark file we're in to return to
  653.         editfile "NUL" return quit      * Quit NUL file if loaded
  654.         gotoblockbeg                    * Return to starting file
  655.         unmarkblock                     * Clear mark
  656.         horizontalwindow                * Make two windows
  657.         editfile return                 * Load empty NUL file
  658.         readblock                       * Read file of buffer names
  659.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  660.     LOOP:                               *
  661.         begline                         * Needed in loop
  662.         unmarkblock                     *
  663.         markline                        * Mark next buffer name
  664.         copy                            * Copy name to scrap
  665.         addline                         * Make room for buff contents
  666.         getscrbuff paste return         * Get buffer contents
  667.         endline                         * Pos and test if buff has contents
  668.     jfalse NOBUFF:                      * If buffer has no contents, move on
  669.         gotoblockend                    * Go to end of buffer contents
  670.         ENDLINE                         * Pos for end of buffer mark
  671.                                         * Needed for last buffer line blank
  672.         #254                            * Add end of buffer mark
  673.         cursordown                      * Move down to next line
  674.         begline endline                 * Test if line is blank
  675.     jfalse DELLINE:                     * If blank, go delete it
  676.     jump LOOP:                          *ELSE loop again
  677.     NOBUFF:                             * Come here if nothing in buffer
  678.         cursordown                      * Test if we're at end of buffer names
  679.     jfalse PICK:                        * If false, PickList is made
  680.         cursorup                        *ELSE cursor up to blank line
  681.         cursorup                        * and to name with no content
  682.         delline                         * Delete buffer name
  683.     DELLINE:                            *
  684.         delline                         * Delete blank line
  685.     jump LOOP:                          * Loop again
  686.     PICK:                               * Come here to select from PickList
  687.         unmarkblock                     * Clear last buffer content's block
  688.         zoomwindow                      * Full window for visibity
  689.         begfile                         * Position to select
  690.         pause                           * Pause to select
  691.         markline copy                   * Copy selected buffer name to scrap
  692.         endline                         * Position of empty space
  693.         dropanchor                      * Mark empty space
  694.         storescrbuff paste return       * Store empty block to selected buff
  695.                                         * removes buffer contents
  696. *         begline                         *
  697.         unmarkblock                     * Unmark
  698.         quit                            * Quit NUL
  699.         prevwindow                      * Return to starting file
  700.         onewindow                       * Close windows if QConfig
  701.     END:                                * set to NOT close on quit
  702. *
  703. * 101 bytes Tue  08-20-1991  11:18:24 (TH @8)
  704.  
  705. * 
  706. * ----------------------------------------------------
  707. * @(9) Save Contents of All Currently Loaded Buffers
  708. *      To Reload at Next Edit Session with @0
  709. * ----------------------------------------------------
  710.  
  711. *     This macro saves the  contents of all currently loaded Scratch
  712. *     Buffers to a file BUFF.ALL to be loaded at the next edit session
  713. *     or while editing using @0.  This macro will ONLY work with line
  714. *     or character blocks, NO column blocks.  Any column block buffer
  715. *     saved with @9 will be loaded with @0 as a CHARACTER block.  To
  716. *     run, invoke this macro at any time, and the macro terminates with
  717. *     the file BUFF.ALL containing all Scratch Buffers currently active
  718. *     and having names contained in the file BUFF.NAM, loaded for
  719. *     viewing.  Terminate the editing session or quit the file BUFF.ALL
  720. *     to continue.
  721.  
  722. *     NOTE: You must change 'e:\up\' to your directory containing
  723. *           BUFF.ALL and BUFF.NAM.
  724.  
  725. *     File BUFF.NAM must exist and is a list of buffer names used.  It
  726. *     is included in AMACxx.ZIP and contains the following buffer names
  727. *     in col 1.
  728.  
  729. *                     1 to 10
  730. *                     a to z
  731. *                     . (dot)
  732.  
  733. *     Edit BUFF.NAM to suit your needs.  Buffer names may also be
  734. *     multiple words.
  735.  
  736. *     ┌─────  BUFF.NAM ──────┐
  737. *     │1                     │<-- Buffer names 1 - 10
  738. *     │2                     │
  739. *     │3                     │
  740. *     │4                     │
  741. *     │5                     │
  742. *     │6                     │
  743. *     │7                     │
  744. *     │8                     │
  745. *     │9                     │
  746. *     │10                    │
  747. *     │a                     │ <-- Buffer names a - z
  748. *     │b                     │     excluding 'n' and 't'
  749. *     │|                     │     reserved for BUFFxx.QM macros.
  750. *     │|                     │
  751. *     │z                     │
  752. *     │.                     │ <-- Buffer name '.' (dot) is
  753. *     └──────────────────────┘     reserved as default name.
  754.  
  755.  
  756. *     The file BUFF.ALL is the contents of Scratch Buffers (Sample from
  757. *     my last editing session is included in AMACxx.ZIP) saved with @9
  758. *     in the form:
  759.  
  760. *     ┌────── BUFF.ALL ──────┐
  761. *     │1                     │<-- Buffer 1 name
  762. *     │Text of buffer 1■     │<-- Buffer 1 content
  763. *     │2                     │<-- Buffer 2 name
  764. *     │This is content of    │<-- Buffer 2 content
  765. *     │buffer number 2.      │               |
  766. *     │                      │               |
  767. *     │Note that buffers may │               |
  768. *     │contain any text      │               |
  769. *     │except for an ASCII   │               |
  770. *     │254.  That is used    │               |
  771. *     │as an end of buffer   │               |
  772. *     │marker                │               |
  773. *     │■                     │<-- NOTE: delimiter on line by itself
  774. *     │3                     │          indicates a blank line.
  775. *     │Buffer 3■             │
  776. *     └──────────────────────┘
  777.  
  778. *     Buffers to be saved may contain any ASCII character except #254,
  779. *     the end of buffer marker.  All scratch buffers are loaded and
  780. *     marked as CHARACTER blocks.
  781.  
  782. @9 macrobegin
  783.         onewindow
  784.         dropanchor                      * Mark file we're in to return to
  785.         editfile "NUL" return quit      * Quit NUL file if loaded
  786.         gotoblockbeg                    * Return to starting file
  787.         unmarkblock                     * Clear mark
  788.         horizontalwindow                * Make two windows
  789.         editfile return                 * Load empty NUL file
  790.         readblock                       * Read file of buffer names
  791.             "e:\up\BUFF.NAM" return     * Change 'e:\up\' to your directory
  792.     LOOP:                               *
  793.         begline                         * Needed in loop
  794.         unmarkblock                     *
  795.         markline                        * Mark next buffer name
  796.         copy                            * Copy name to scrap
  797.         addline                         * Make room for buff contents
  798.         getscrbuff paste return         * Get buffer contents
  799.         endline                         * Pos and test if buff has contents
  800.     jfalse NOBUFF:                      * If buffer has no contents, move on
  801.         gotoblockend                    * Go to end of buffer contents
  802.         ENDLINE                         * Pos for end of buffer mark
  803.                                         * Needed for last buffer line blank
  804.         #254                            * Add end of buffer mark
  805.         cursordown                      * Move down to next line
  806.         begline endline                 * Test if line is blank
  807.     jfalse DELLINE:                     * If blank, go delete it
  808.     jump LOOP:                          *ELSE loop again
  809.     NOBUFF:                             * Come here if nothing in buffer
  810.         cursordown                      * Test if we're at end of buffer names
  811.     jfalse PICK:                        * If false, PickList is made
  812.         cursorup                        *ELSE cursor up to blank line
  813.         cursorup                        * and to name with no content
  814.         delline                         * Delete buffer name with no content
  815.     DELLINE:                            *
  816.         delline                         * Delete blank line
  817.     jump LOOP:                          * Loop again
  818.     PICK:                               *
  819.         writeblock                      * Begin writeblock
  820.         backspace backspace backspace   * Remove 'nam' extension
  821.         "ALL" return "O"                * Save all scratch buffer contents
  822.                                         *  to BUFF.ALL with overwrite
  823.         editfile return quit            * Quit BUFF.ALL if loaded
  824.         editfile return                 * Load BUFF.ALL to see if all Ok
  825.         onewindow                       * Close windows
  826.     END:                                *
  827. *
  828. * 105 bytes Tue  08-20-1991  11:22:05 (TH @9)
  829.  
  830. * (VERSION) HISTORY
  831.  
  832. *   1.0 -   Initial.  Includes @1, @2 and @3.                          8/17/91
  833. *       -   1.0 posted SemWare Macros Conference to D Thompson and     8/17/91
  834. *           and J Goodman.
  835. *   1.1 -   Added @6. Modified @1, @2 and @3.                          8/19/91
  836. *   1.2 -   Added @4 and @7 - @0.                                      8/20/91
  837. *       -   Swapped @2 and @3 keys.                                    8/22/91
  838. *       -   @1 ans @2 sent to Joseph Carnage (RelayNet).               8/22/91
  839. *
  840. *
  841. *
  842. *
  843. *
  844. *-- eof
  845.  
  846. *
  847. *       -   @1 ans @2 sent to Joseph Carnage.                          8/22/91
  848. *
  849. *
  850. *
  851.  
  852. *     To: Mike Nolan and ALL                                   8/19/91
  853.  
  854. *     I hope you don't mind me posting these new macros to your
  855. *     attention.  I am doing so hoping you (and anyone else caring to)
  856. *     might be able to test them and also to show you, as a result of
  857. *     your suggestions and constructive criticism of the AMAC
  858. *     documentation, what I think may be *better* documentation.  I
  859. *     will be interested to hear what you think.  Let me assure you, I
  860. *     am always in the mood for constructive criticism and suggestions,
  861. *     so fire something back if and when you can.  I won't be offended
  862. *     if you can't or don't respond.
  863.  
  864. *     Please NOTE: @6 requires that 'e:\up\' (my directory) be changed
  865. *                  to your directory containing the file BUFF.NAM
  866. *                  which is a list of Scratch Buffer names that needs
  867. *                  to be made before using @6 as explained below.
  868.  
  869. *     I am encouraged by how well these macros are developing for the
  870. *     user to be able to access Scratch Buffers quickly without having
  871. *     to retype a buffer name each time unless the name is different
  872. *     from the last accessed Scratch Buffer.  I found several
  873. *     conditions where my macros posted in SemWare Macros Conference 3,
  874. *     Messages 581-584, did not work properly.  The following macros in
  875. *     the continuing messages are revisions to these macros @1, @3 and
  876. *     @2 sent previously which should now work properly.  I am also
  877. *     including a new macro @6 to View Contents of All Currently Loaded
  878. *     Scratch Buffers.  These macros access Scratch Buffers identical
  879. *     to how StoreScrBuff, AppendScrBuff and GetScrBuff work except the
  880. *     last accessed buffer name is entered at the buffer name prompt
  881. *     allowing for quicker Scratch Buffer access.  QEdit does not
  882. *     currently show the last accessed buffer name at the buffer name
  883. *     prompt.  These macros should be useful for quickly accessing
  884. *     Scratch Buffers.
  885.  
  886. *     NOTE: To use @6 you must change 'e:\up\' in macro @6 to your
  887. *           directory containing BUFF.NAM.  This file must exist for
  888. *           this macro to work, and it is easily be made as shown
  889. *           below.
  890.  
  891. *     I am still working to come up with a way to select a Scratch
  892. *     Buffer name from a PickList of all currently loaded Scratch
  893. *     Buffers showing buffer name and contents, and a macro to
  894. *     autoexecute on start up and load all Scratch Buffers active in
  895. *     the last editing session.  This was not as easy to do as I
  896. *     expected.  If you are interested I will be glad to post these if
  897. *     and when I get them working properly.  Just let me know.
  898.  
  899. *     If you find any problems with these new macros or have any
  900. *     suggestions or criticism, I would really like to know.  Thanks.
  901.  
  902. *     ... Tom
  903.  
  904.  
  905. *     To: John Goodman and ALL                                    8/17/91
  906.  
  907. *     The following macros (@1, @3 and @2 in the three continuing
  908. *     messages) are my first effort to Copy, Append or Insert Scratch
  909. *     Buffers in a manner identical to how StoreScrBuff, AppendScrBuff
  910. *     and GetScrBuff work except the last accessed buffer name is
  911. *     entered at the buffer name prompt allowing for quicker Scratch
  912. *     Buffer access:
  913.  
  914. *     These macros are useful for quickly accessing Scratch Buffers
  915. *     They will fit on one line of QCONFIG.DAT by removing the 'Label'
  916. *     and 'Macro_Begin' from QMAC compiled @1 and @3 macros.  If you are
  917. *     interested in having macros to be able to select a Scratch Buffer
  918. *     name from a PickList of all active Scratch Buffers showing buffer
  919. *     name and contents, and a macro to autoexecute on start up and
  920. *     load all Scratch Buffers active in the last editing session,
  921. *     please let me know, and I'll try to put something together.  I
  922. *     think this can be done, but it will require some work.
  923.  
  924. *     If you find any problems with these new macros, I would really
  925. *     like to know.  No effort has been spent optimizing, and I also
  926. *     would like to hear any suggestions or comments.  Thanks.
  927.  
  928. *     ... Tom
  929.